package ru.amse.tsyganov.jumleditor.view;

import java.util.ArrayList;
import java.util.List;

import ru.amse.tsyganov.jumleditor.model.ActivityGraph;
import ru.amse.tsyganov.jumleditor.model.Partition;

public class ActivityGraphView<T extends ActivityGraph> extends View<T> {
	private final List<PartitionView<Partition>> partitions;

	public ActivityGraphView(T model) {
		setModel(model);
		partitions = new ArrayList<PartitionView<Partition>>();
		transferData();
	}

	public List<PartitionView<Partition>> getPartitions() {
		return partitions;
	}

	private void transferData() {
		for (Partition p : getModel().getPartitions()) {
			partitions.add(new PartitionView<Partition>(p));
		}
	}
}
